package com.yuanian.ecsplus.codeautomation.vistor;

import com.yuanian.ecsplus.annotation.BusinessObject;
import com.yuanian.ecsplus.codeautomation.context.Context;

public class EntityCodeVisitor implements CodeVisitor {

    @Override
    public void visitPackage(Context context) {
        context.getCode().getPackageCode().startLine(0).append("package").append("xxxxxx").endLine();
    }

    @Override
    public void visitImport(Context context) {
        context.getCode().getImportCode().startLine(0).append("import").append("com.yuanian.ecsplus.model.entity.BaseModel").endLine();
    }

    @Override
    public void visitClass(Context context) {
        context.getCode().getClassCode().startLine(0).append("@BusinessObject(apiName = \"" + context.getApiName() + "\"), tableName = \"" + context.getTableName()  + "\" ").endLine();
        context.getCode().getClassCode().startLine(0).append("public class").append("xxxx").append("extends BaseModel ").startNest();
    }

    @Override
    public void visitField(Context context) {

    }

    @Override
    public void visitConstructor(Context context) {

    }

    @Override
    public void visitMethod(Context context) {

    }
}
